<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">

<h:head>
	<title>祖龙娱乐  - BI系统</title>
	<link href="../../css/component.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="../../js/highcharts.js"></script>
	<script type="text/javascript" src="../../js/drawChart.js"></script>
</h:head>

<h:body>
	<ui:param name="bean" value="#{levelGameAction}" />
	
	<span class="pagetitle">游戏内分析 —— 角色等级分析</span>
	<p:separator />
	
	<!-- 右侧页面顶部查询部分 -->
	<h:form id="fsearch">
		<p:growl id="growl0" showDetail="true" sticky="true" />
        <p:calendar value="#{bean.dayDate}" mode="popup" pattern="yyyy-MM-dd" />
		&#160;&#160;&#160;
		<p:selectOneMenu id="platformSel1" styleClass="queryPlatform" value="#{bean.queryPlatform}">
	        <f:selectItems value="#{bean.platformItmes}" />
	        <p:ajax update="channelSel1 serverSel1" listener="#{bean.updateChannelItmes}" />
        </p:selectOneMenu>
        &#160;&#160;&#160;
        
        <p:selectOneMenu id="channelSel1" styleClass="queryChannel" value="#{bean.queryChannel}">
	        <f:selectItems value="#{bean.channelItmes}" />
	        <p:ajax update="serverSel1 platformSel1" listener="#{bean.updateServerItmes}" />
        </p:selectOneMenu>
        &#160;&#160;&#160;
        
        <p:selectOneMenu id="serverSel1" styleClass="queryServer" value="#{bean.queryServer}">
	         <f:selectItems value="#{bean.serverItmes}" />
	         <p:ajax update="channelSel1 platformSel1" listener="#{bean.selectedServer}" />
        </p:selectOneMenu>
        &#160;&#160;&#160;

        <p:selectOneMenu id="job1" styleClass="queryServer" value="#{bean.queryJob}">
            <f:selectItems value="#{bean.jobs}" />
        </p:selectOneMenu>
        &#160;&#160;&#160;

        <br />
        <hr align="left" width="44%" style="height : 1px" />

        <p:calendar value="#{bean.dayDate1}" mode="popup" pattern="yyyy-MM-dd" />
        &#160;&#160;&#160;
        <p:selectOneMenu id="platformSel2" styleClass="queryPlatform" value="#{bean.queryPlatform1}">
            <f:selectItems value="#{bean.platformItmes1}" />
            <p:ajax update="channelSel2 serverSel2" listener="#{bean.updateChannelItmes1}" />
        </p:selectOneMenu>
        &#160;&#160;&#160;

        <p:selectOneMenu id="channelSel2" styleClass="queryChannel" value="#{bean.queryChannel1}">
            <f:selectItems value="#{bean.channelItmes1}" />
            <p:ajax update="serverSel2 platformSel2" listener="#{bean.updateServerItmes1}" />
        </p:selectOneMenu>
        &#160;&#160;&#160;

        <p:selectOneMenu id="serverSel2" styleClass="queryServer" value="#{bean.queryServer1}">
            <f:selectItems value="#{bean.serverItmes1}" />
            <p:ajax update="channelSel2 platformSel2" listener="#{bean.selectedServer1}" />
        </p:selectOneMenu>
        &#160;&#160;&#160;

        <p:selectOneMenu id="job2" styleClass="queryServer" value="#{bean.queryJob1}">
            <f:selectItems value="#{bean.jobs}" />
        </p:selectOneMenu>
        &#160;&#160;&#160;

        <p:commandButton value="对比查询" action="#{bean.search()}" update=":data" ajax="false" />
	</h:form>
	<br />
	
	<!-- 数据展示部分，包含表格和图表 -->
	<h:form id="dform">
		<div class="data" id="data">
            <h:panelGrid columns="1" style="width:100%">
                <div id="basewidth" style="width:94%;height:0; border:0;">
                </div>
            </h:panelGrid>

            <p:panel id="panel100" header="新增角色职业等级分布" style="margin-bottom:10px;">
                <p:dataGrid id="chart100" var="c" value="#{bean.newRoleSchoolLevelDistributeChart}" columns="1" layout="grid">
                    <p:panel style="text-align:center">
                        <h:panelGrid columns="1" style="width:100%">
                            <div id="highchartChart100" style="width:100%;height:350px; border:0;">
                                <script type="text/javascript">
                                    generateChart('#{c.jsonStr}', '#{c.jsonType}', '100');
                                </script>
                            </div>
                        </h:panelGrid>
                    </p:panel>
                </p:dataGrid>

                <p:accordionPanel activeIndex="-1">
                    <p:tab title="点击查看详细数据">
                        <p:dataTable id="dlist100" var="l" value="#{bean.newRoleSchoolLevelDistributeDatas}" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
                            <f:facet name="{Exporters}">
                                <h:commandLink styleClass="exporter">
                                    <p:graphicImage url="/resources/images/excel.png" height="25px"/>
                                    <p:dataExporter type="xls" target="dlist100" fileName="NewRoleSchoolLevelDistributeDatas-#{pageHelper.getNewDateDetailStr()}"/>
                                </h:commandLink>
                            </f:facet>

                            <p:column headerText="日期" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{l.day}" />
                            </p:column>
                            <p:column headerText="平台" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{pageHelper.getPlatformNameById(l.platformId)}" />
                            </p:column>
                            <p:column headerText="渠道" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{pageHelper.getChannelNameById(l.channelId)}" />
                            </p:column>
                            <p:column headerText="区服" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{pageHelper.getServerNameById(l.serverId)}" />
                            </p:column>
                            <p:column headerText="职业" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{l.schoolName}" />
                            </p:column>
                            <p:column headerText="等级" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{l.level}" />
                            </p:column>
                            <p:column headerText="角色数" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{l.num}" />
                            </p:column>
                            <p:column headerText="等级人数占比" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{pageHelper.double2Percent(l.levelPercent)}" />
                            </p:column>
                        </p:dataTable>
                    </p:tab>
                </p:accordionPanel>
            </p:panel>
            <br />
            <p:separator />

            <p:panel id="panel2" header="次日流失新增角色职业等级分布" style="margin-bottom:10px;">
                <p:dataGrid id="chart2" var="c" value="#{bean.newRoleSchoolSecondLostLevelDistributeChart}" columns="1" layout="grid">
                    <p:panel style="text-align:center">
                        <h:panelGrid columns="1" style="width:100%">
                            <div id="highchartChart4" style="width:100%;height:350px; border:0;">
                                <script type="text/javascript">
                                    generateChart('#{c.jsonStr}', '#{c.jsonType}', '4');
                                </script>
                            </div>
                        </h:panelGrid>
                    </p:panel>
                </p:dataGrid>

                <p:accordionPanel activeIndex="-1">
                    <p:tab title="点击查看详细数据">
                        <p:dataTable id="dlist4" var="l" value="#{bean.newRoleSchoolSecondLostLevelDistributeDatas}" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
                            <f:facet name="{Exporters}">
                                <h:commandLink styleClass="exporter">
                                    <p:graphicImage url="/resources/images/excel.png" height="25px"/>
                                    <p:dataExporter type="xls" target="dlist4" fileName="NewRoleSchoolSecondLostLevelDistributeDatas-#{pageHelper.getNewDateDetailStr()}"/>
                                </h:commandLink>
                            </f:facet>

                            <p:column headerText="日期" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{l.day}" />
                            </p:column>
                            <p:column headerText="平台" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{pageHelper.getPlatformNameById(l.platformId)}" />
                            </p:column>
                            <p:column headerText="渠道" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{pageHelper.getChannelNameById(l.channelId)}" />
                            </p:column>
                            <p:column headerText="区服" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{pageHelper.getServerNameById(l.serverId)}" />
                            </p:column>
                            <p:column headerText="职业" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{l.schoolName}" />
                            </p:column>
                            <p:column headerText="等级" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{l.level}" />
                            </p:column>
                            <p:column headerText="角色数" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{l.num}" />
                            </p:column>
                            <p:column headerText="等级人数占比" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{pageHelper.double2Percent(l.levelPercent)}" />
                            </p:column>
                        </p:dataTable>
                    </p:tab>
                </p:accordionPanel>
            </p:panel>
            <br />
            <p:separator />

			<p:panel id="panel0" header="活跃角色职业等级分布" style="margin-bottom:10px;">
				<p:dataGrid id="chart0" var="c" value="#{bean.activeRoleSchoolLevelDistributeChart}" columns="1" layout="grid">
			        <p:panel style="text-align:center">
			            <h:panelGrid columns="1" style="width:100%">
			                <div id="highchartChart1" style="width:100%;height:350px; border:0;">
								<script type="text/javascript">
									generateChart('#{c.jsonStr}', '#{c.jsonType}', '1');
								</script>  
							</div>
			            </h:panelGrid>
			        </p:panel>
			    </p:dataGrid>

                <p:accordionPanel activeIndex="-1">
                    <p:tab title="点击查看详细数据">
                        <p:dataTable id="dlist1" var="l" value="#{bean.activeRoleSchoolLevelDistributeDatas}" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
                            <f:facet name="{Exporters}">
                                <h:commandLink styleClass="exporter">
                                    <p:graphicImage url="/resources/images/excel.png" height="25px"/>
                                    <p:dataExporter type="xls" target="dlist1" fileName="ActiveRoleSchoolLevelDistributeDatas-#{pageHelper.getNewDateDetailStr()}"/>
                                </h:commandLink>
                            </f:facet>

                            <p:column headerText="日期" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{l.day}" />
                            </p:column>
                            <p:column headerText="平台" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{pageHelper.getPlatformNameById(l.platformId)}" />
                            </p:column>
                            <p:column headerText="渠道" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{pageHelper.getChannelNameById(l.channelId)}" />
                            </p:column>
                            <p:column headerText="区服" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{pageHelper.getServerNameById(l.serverId)}" />
                            </p:column>
                            <p:column headerText="职业" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{l.schoolName}" />
                            </p:column>
                            <p:column headerText="等级" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{l.level}" />
                            </p:column>
                            <p:column headerText="角色数" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{l.num}" />
                            </p:column>
                            <p:column headerText="等级人数占比" styleClass="column" style="width:80px">
                                <h:outputLabel value="#{pageHelper.double2Percent(l.levelPercent)}" />
                            </p:column>
                        </p:dataTable>
                    </p:tab>
                </p:accordionPanel>
    		</p:panel>
            <br />
            <p:separator />

    		<p:panel id="panel3" header="角色职业等级通过率" style="margin-bottom:10px;">
                <p:dataTable id="dlist2" var="l" value="#{bean.roleSchoolLevelPassRadioDatas}" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
                    <f:facet name="{Exporters}">
                        <h:commandLink styleClass="exporter">
                            <p:graphicImage url="/resources/images/excel.png" height="25px"/>
                            <p:dataExporter type="xls" target="dlist2" fileName="RoleSchoolLevelPassRadioDatas-#{pageHelper.getNewDateDetailStr()}"/>
                        </h:commandLink>
                    </f:facet>

                    <p:column headerText="日期" styleClass="column" style="width:80px">
                        <h:outputLabel value="#{l.day}" />
                    </p:column>
                    <p:column headerText="平台" styleClass="column" style="width:80px">
                        <h:outputLabel value="#{pageHelper.getPlatformNameById(l.platformId)}" />
                    </p:column>
                    <p:column headerText="渠道" styleClass="column" style="width:80px">
                        <h:outputLabel value="#{pageHelper.getChannelNameById(l.channelId)}" />
                    </p:column>
                    <p:column headerText="区服" styleClass="column" style="width:80px">
                        <h:outputLabel value="#{pageHelper.getServerNameById(l.serverId)}" />
                    </p:column>
                    <p:column headerText="职业" styleClass="column" style="width:80px">
                        <h:outputLabel value="#{l.schoolName}" />
                    </p:column>
                    <p:column headerText="等级" styleClass="column" style="width:80px">
                        <h:outputLabel value="#{l.level}" />
                    </p:column>
                    <p:column headerText="首日通过率" styleClass="column" style="width:80px">
                        <h:outputLabel value="#{pageHelper.isBig(l.day, 1) ? pageHelper.double2Percent(l.firstDayPassRadio) : '-'}" />
                    </p:column>
                    <p:column headerText="首周通过率" styleClass="column" style="width:80px">
                        <h:outputLabel value="#{pageHelper.isBig(l.day, 7) ? pageHelper.double2Percent(l.firstWeekPassRadio) : '-'}" />
                    </p:column>
                    <p:column headerText="双周通过率" styleClass="column" style="width:80px">
                        <h:outputLabel value="#{pageHelper.isBig(l.day, 14) ? pageHelper.double2Percent(l.secondWeekPassRadio) : '-'}" />
                    </p:column>
                    <p:column headerText="首月通过率" styleClass="column" style="width:80px">
                        <h:outputLabel value="#{pageHelper.isBig(l.day, 30) ? pageHelper.double2Percent(l.firstMonthPassRadio) : '-'}" />
                    </p:column>
                </p:dataTable>
    		</p:panel>
		</div>
	</h:form>

	<!-- 页脚 -->
	<div class="footer"></div>
</h:body>
</html>